package com.pattern.observer;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 抽象目标
 * @Author: whp
 * @Date: 2021-01-28 17:21
 */
public abstract class Subject {
    protected List<Observer> observers = new ArrayList<>();

    public void add(Observer observer) {
        observers.add(observer);
    }

    public void del(Observer observer) {
        observers.remove(observer);

    }

    public abstract void notifyObserver();


}
